import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import './savelabel.css'
import { AtInput,AtButton,AtIcon,AtAvatar }  from 'taro-ui'
import { $navigateBack, $redirectTo,getGlobalData } from '../../../global';
import reactMixin from 'react-mixin';
import myJs from '../../pages/savelabel/savelabeljs.js'
import app from '../../../main.js'

export default class SaveLabel extends Component {

  config = {
    navigationBarTitleText: '保存标签'
  }
  constructor () { 
        super(...arguments); 
        this.state = this.getData(); 
    }
  constructor () {
    super(...arguments)
    this.state = {
      value: '门诊患者'
    }
  }
  handleChange (value) {
    this.setState({
      value
    })
  }

  saveLable=()=>{
    $navigateBack();
  }

  deleteLable=()=>{
    $navigateBack();
  }

  go(){
    app.redirectTo('../updatepatient/updatepatient')
  }

  componentWillMount () { }

  componentDidMount () { }

  componentWillUnmount () { }

  componentDidShow () { }

  componentDidHide () { }

  render () {
    return (
      <View className='save-label'>
        <AtInput
        className='tags t-gray'
        editable={false}
        name='value'
        title='标签名称'
        type='text'
      />
      <View className='tag-input'>
      <AtIcon value='close-circle' className='close-icon' size='20' color='#999999'></AtIcon>
      <AtInput
        className='tags tags-input'
        name='value'
        type='text'
        value={this.state.value}
        onChange={this.handleChange.bind(this)}
      />
      </View>
      <AtInput
        className='tags t-gray'
        editable={false}
        name='value'
        title='标签成员'
        type='text'
      />
      <View className='member'>   
      <View className='head head-tag'><AtAvatar circle image={getGlobalData('baseurl')+'img/d2.jpg'} className='img'></AtAvatar>刘新池</View>
      <View className='head head-tag'><AtAvatar circle image={getGlobalData('baseurl')+'img/d3.jpg'} className='img'></AtAvatar>周星星</View>
      <View className='head head-tag'><AtAvatar circle image={getGlobalData('baseurl')+'img/d2.jpg'} className='img'></AtAvatar>王小虎</View>
      <View className='head head-tag'><AtAvatar circle image={getGlobalData('baseurl')+'img/d3.jpg'} className='img'></AtAvatar>刘新池</View>
      <View className='head head-tag'><AtAvatar circle image={getGlobalData('baseurl')+'img/d2.jpg'} className='img'></AtAvatar>周星星</View>
      <View className='head head-tag'><AtAvatar circle image={getGlobalData('baseurl')+'img/d3.jpg'} className='img'></AtAvatar>王小虎</View>
      <AtIcon value='add-circle' size='54' color='#b1b1b1' className='head-tag icon' onClick={this.go}></AtIcon>
      <AtIcon value='subtract-circle' size='54' color='#b1b1b1' className='head-tag icon' onClick={this.go}></AtIcon>
      </View>
    <View className='btn-box '>
    <View className='s-box'><AtButton className='btn del-btn' onClick={this.deleteLable}>取消保存</AtButton></View>
    <View className='s-box'><AtButton className='btn save-btn' onClick={this.saveLable}>保存标签</AtButton></View>
    </View>
      </View>
      
    )
  }
}
reactMixin.onClass(SaveLabel,myJs);
